<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/resources/bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/resources/css/font-awesome.min.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/resources/css/theme.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/resources/css/carousel.css">
    <style>
        .nav-tabs > li.active > a, .nav-tabs > li.active > a:focus, .nav-tabs > li.active > a:hover {
            border-bottom-color: #ddd;
        }

        .nav-tabs > li > a {
            border-radius: 0;
        }

        span {
            display: none;
            color: #d43f3a;
        }
    </style>
</head>
<body>
<div class="navbar-wrapper">
    <%--动态导入另一个jsp页面，作用：将公共使用的部分提取出来，然后使用动态导入
          动态导入是不会导入include页面的编译指令的，而是仅仅将被导入页面的body内容插入本页面。--%>
    <jsp:include page="leader-header.jsp"></jsp:include>
</div>

<div class="container theme-showcase" role="main">
    <%--动态导入另一个jsp页面，作用：将公共使用的部分提取出来，然后使用动态导入
           动态导入是不会导入include页面的编译指令的，而是仅仅将被导入页面的body内容插入本页面。--%>
    <jsp:include page="leader-top.jsp"></jsp:include>
    <div class="container">
        <div class="row clearfix">
            <div class="col-md-12 column">
                <form id="upUser" name="form1" action="/tbLeader/upTbLeader" method="post" class="form-horizontal"
                      role="form">
                    <div class="form-group ">
                        <label>
                            用户名
                            <span id="sp">用户名不能为空或用户名长度最短4字符</span>
                        </label>
                        <input id="leaderAccount" name="leaderAccount" readonly type="text" maxlength="255"
                               value="${account}"
                               class="form-control"
                               placeholder="请输入登陆用户名"/>
                    </div>
                    <div class="form-group ">
                        <label>
                            新密码
                            <span id="sp2">数字字母组成最少6位</span>
                        </label>
                        <input id="leaderPassword" name="leaderPassword" type="password" maxlength="50"
                               class="form-control form_datetime" placeholder="填写新密码"/>
                    </div>
                    <div class="form-group ">
                        <label>
                            新密码验证
                            <span id="sp3">密码不一致</span>
                        </label>
                        <input id="rePassword" name="rePassword" type="password" maxlength="50"
                               class="form-control form_datetime" placeholder="再次输入新密码"/>
                    </div>
                    <div class=" form-group">
                        <button id="update" type="submit" name="btnSubmit" class="btn btn-primary">保存修改</button>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
<script src="${pageContext.request.contextPath}/resources/jquery/jquery-2.1.1.min.js"></script>
<script src="${pageContext.request.contextPath}/resources/bootstrap/js/bootstrap.min.js"></script>
<script src="${pageContext.request.contextPath}/resources/script/docs.min.js"></script>
<script src="${pageContext.request.contextPath}/resources/script/back-to-top.js"></script>

</body>
<script>
    $(function () {

        $('input').focus(function () {
            $('input').css("border-color", "#CCC");
        });

        $('#update').click(function panduan() {
            console.log($("#leaderAccount").val().length);
            if ($("#leaderAccount").val() == "" || $("#leaderAccount").val().length < 4) {
                $("#leaderAccount").css("border-color", "red");
                $('#sp').show();
                return false;
            } else {
                $('#sp').attr("display", 'none');
            }
            if ($("#leaderPassword").val() == "" || $("#leaderPassword").val().length < 6) {
                $("#leaderPassword").css("border-color", "red");
                $('#sp2').show();
                return false;
            } else {
                $('#sp2').attr("display", 'none');
            }
            if ($("#rePassword").val() == "" || $("#rePassword").val().length < 6 || $("#rePassword").val() != $("#rePassword").val()) {
                $("#rePassword").css("border-color", "red");
                $('#sp3').show();
                return false;
            } else {
                $('#sp3').attr("display", 'none');
            }
            var status = '<%=session.getAttribute("status")%>';
            var msg = '<%=session.getAttribute("msg")%>';
            if (status == "001" || status == 1) {
                alert(msg)
            }

        })
    })
</script>
</html>
